#include <G4Event.hh>
#include <G4HCofThisEvent.hh>

#include "EventAction.hh"
#include "HitsCollection.hh"
#include "Messenger.hh"
#include "PMTHit.hh"

EventAction::EventAction() {
	;
}

EventAction::~EventAction() {
	;
}

void EventAction::BeginOfEventAction(const G4Event*) {
	;
}

void EventAction::EndOfEventAction(const G4Event* event) {
	G4HCofThisEvent* hcc = event->GetHCofThisEvent();

	HitsCollection* leftPMTHC = (HitsCollection*) (hcc->GetHC(0));
	HitsCollection* rightPMTHC = (HitsCollection*) (hcc->GetHC(1));

	messenger->AddHits(leftPMTHC->GetSize() + rightPMTHC->GetSize());
}
